﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ECare.BUS.Data;
using ECare.Database;

namespace ECare.BUS
{
   public  class GetPlanDetailStepsHelper:BackgroundWorker
    {
       public GetPlanDetailStepsHelper()
       {
           this.DoWork += GetPlanDetailStepsHelper_DoWork;
       }
       public PlanInfo currentPlan { get; set; }
       void GetPlanDetailStepsHelper_DoWork(object sender, DoWorkEventArgs e)
       {
           var detail = PlanHelper.GetUNFinishedPlanDetail(this.currentPlan);

           if (detail == null)
           {
               e.Result = null;
           }
           else
           {
               e.Result = PlanHelper.GetPlanDetailSteps(detail);
           }
       }
    }
}
